{include file="$usertemplate/header.tpl.html" title=header}
{literal}
<script type="text/javascript" language="javascript">
$().ready(function(){
    $(".capnhat a").click(function(){
        $("#frmBooking").submit();
    });		
});

</script>
{/literal}
<div class="content">
    <div class="leftCont">
        <div class="boxpro">
            <div class="tt-boxpro">
                 <ul>
                     <li class="tt-left"><p>Thông tin giỏ hàng</p></li>
                 </ul>
             </div><!--tt-boxpro-->
            {if $cartItems}
            <div class="cc-boxpro">
                <form name="frmBooking" id="frmBooking" action="" method="post">
                <div class="giohang">
                    <p>Giỏ hàng của bạn</p>
                    <div class="tt-ctgh">
                        <ul>
                            <li class="tensp"><p>Tên sản phẩm</p></li>
                            <li class="sluong"><p>Số lượng</p></li>
                            <li class="gtien"><p>Giá tiền</p></li>
                            <li class="ttien"><p>Tổng tiền</p></li>
                            <li class="xoasp"><p>Xóa</p></li>
                        </ul>
                    </div><!--tt-ctgh-->
                    <div class="cc-ctgh">

                        {foreach from=$cartItems item=cartItem}
                        <div class="dong-chitiet">
                            <ul>
                                <li class="tensp"><p>{$cartItem->getProductName()}</p></li>
                                <li class="sluong" style="text-align:center;">
                                    <input type="hidden" name="cIds[]" value="{$cartItem->getId()}" />
                                    <input type="text" name="quantity[]" value="{$cartItem->getQuantity()}" style="width:20px; height:20px; margin-top:10px;"/>
                                </li>
                                <li class="gtien"><span>{$cartItem->getPrice()|number_format:0:",":"."} {$messages.currency}</span></li>
                                <li class="ttien">
                                {assign var=price value=$cartItem->getPrice()}
                                {assign var=quantity value=$cartItem->getQuantity()}
                                {assign var=subTotal value=$price*$quantity}
                                {assign var=grandTotal value=$grandTotal+$subTotal}
                                <span>{$subTotal|number_format:0:",":"."} {$messages.currency}</span>
                                </li>
                                <li class="xoasp" style="text-align:center;">
                                    <input type="checkbox" name="dIds[]" value="{$cartItem->getId()}" style="margin-top:10px;"/>
                                    <input type="hidden" name="op" value="shopping" />
                                    <input type="hidden" name="plus" value="updateCart" />
                                    <input type="hidden" name="lang" value="{$lang}" />                    
                                </li>
                            </ul>
                        </div><!--dong-chitiet-->
                        {/foreach}
                        <div class="tongtientinh">
                            <ul>
                                <li class="tttt"><p>Tổng tiền cần thanh toán:</p></li>
                                <li class="cccc"><span>{$grandTotal|number_format:0:",":"."} {$messages.currency}</span></li>
                            </ul>
                        </div><!--tongtientinh-->
                        <div class="nutnut">
                            <ul>
                                <li class="capnhat"><a href="javascript:;"><img src="{$ROOTPATH}/templates/{$usertemplate}/images/nut-capnhat.jpg" /></a></li>                                    
                                <li class="tieptuc">
                                    {if $procatId}
                                    {assign var=procatSlug value=$productcategories->getProCate('slug', "id = $category")}
                                        <a href="{$ROOTPATH}/{$procatSlug}-{$procatId}c.html" title="{$messages.continue}"><img src="{$ROOTPATH}/templates/{$usertemplate}/images/nut-tieptucmuahang.jpg" /></a>
                                    {else}
                                        <a href="{$ROOTPATH}/index.html" title="{$messages.continue}"><img src="{$ROOTPATH}/templates/{$usertemplate}/images/nut-tieptucmuahang.jpg" /></a>
                                    {/if}
                                </li>
                                <li class="thanhtoan"><a href="{$ROOTPATH}/order.html"><img src="{$ROOTPATH}/templates/{$usertemplate}/images/nut-thanhtoan.jpg" /></a></li>
                                <!--<li class="guidon"><a href="#"><img src="{$ROOTPATH}/templates/{$usertemplate}/images/nut-guidon.jpg" /></a></li>-->
                            </ul>
                        </div><!--nutnut-->
                    </div><!--cc-ctgh-->
                </div><!--giohang-->
            </form>
            </div>
            {else}
            <div class="cc-boxpro">
                <p class="noproduct">Chưa có sản phẩm nào trong giỏ hàng của bạn. Click vào <a href="{$ROOTPATH}/san-pham.html">đây</a> để tiếp tục mua hàng</p>
            </div>
            {/if}
        </div>
    </div><!--leftCont-->
    {include file="$usertemplate/right.tpl.html" title=right}
</div>
{include file="$usertemplate/footer.tpl.html" title=footer}                    